#pragma once
# include <wrl/client.h>
# include <vector>
# include <shared_mutex>

struct ID3D11Device;
struct ID3D11DeviceContext;
struct ID3D11Texture2D;
struct ID3D11RenderTargetView;
struct ID3D11ShaderResourceView;
class BindAbleInterface;

class RenderTargerTexture {
public:
	RenderTargerTexture(ID3D11Device* _device, int _width, int _height);
	void renderTo(ID3D11DeviceContext* _context);
	void bind(ID3D11DeviceContext* _context);
	void insertBindAble(BindAbleInterface* _bind_able);
	ID3D11Texture2D* getCopyTexture() const;
	void copyTexture(ID3D11DeviceContext* _context);
	~RenderTargerTexture();
private:
	Microsoft::WRL::ComPtr<ID3D11Texture2D> m_texture = nullptr;
	Microsoft::WRL::ComPtr<ID3D11RenderTargetView> m_render_target_view = nullptr;
	Microsoft::WRL::ComPtr<ID3D11ShaderResourceView> m_shader_resource_view = nullptr;

	Microsoft::WRL::ComPtr<ID3D11Texture2D> m_copy_texture = nullptr;
	std::vector<BindAbleInterface*>* m_bind_able = nullptr;

	
	int m_index_size = 0;
};
